package com.hwl.demo20;

import com.hwl.demo20.service.impl.Iraq;
import com.hwl.demo20.service.impl.USA;
import com.hwl.demo20.service.impl.UnitedNationsSecurityCouncil;

/**
 * 中介者模式
 *
 * @author sentry
 * @since 2023-03-26
 */
public class Main {

    public static void main(String[] args) {
        UnitedNationsSecurityCouncil UNSC = new UnitedNationsSecurityCouncil();
        USA c1 = new USA(UNSC);
        Iraq c2 = new Iraq(UNSC);

        UNSC.setCountryUSA(c1);
        UNSC.setCountryIraq(c2);

        c1.declare("不准研制核武器，否则要发动战争！");
        c2.declare("我们没有核武器，也不怕侵略！");
    }
}
